﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BLL;
using DAL;
using DACNPM.MyUserControl.UCHienThi;

namespace DACNPM.MyUserControl.UCMenu
{
    public partial class UCChucNangDDH : UserControl
    {
        String idnhanvien;
        public UCChucNangDDH(String idtoancuc)
        {
            InitializeComponent();
            this.idnhanvien = idtoancuc;
            showThongTinDangNhap();
        }

        /// <summary>
        /// Hiển thị thông tin đăng nhập
        /// </summary>
        void showThongTinDangNhap()
        {
            UserBUO userBUO = new UserBUO();
            NhanVienBUO nvBUO = new NhanVienBUO();
            String quyen = userBUO.ThongTinDangNhap(idnhanvien);
            String tennhanvien = nvBUO.GetSingle(idnhanvien).TenNhanVien.ToString();
            lblHoTen.Text = tennhanvien;
            lblQuyenHan.Text = quyen;
            lblMaNV.Text = idnhanvien;
        }
        private void btnDanhSachDDH_Click(object sender, EventArgs e)
        {
            UCDanhSachDDH ucDSDDH = new UCDanhSachDDH(idnhanvien);
            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucDSDDH, "grbHienThiChucNang");
        }

        private void btnThemDDH_Click(object sender, EventArgs e)
        {
            UCThemDDH ucThemDDH = new UCThemDDH(idnhanvien);
            Form form = this.ParentForm;

            ControlAccess.ShowConTrol(form, ucThemDDH, "grbHienThiChucNang");
        }
    }
}
